package com.itheima.homework.Three;

public class Computer implements Comparable<Computer>{
    private String bond;
    private int price;
    private String color;

    @Override
    public int compareTo(Computer o) {
        int price1 = this.price;
        int price2 = o.getPrice();

        int i = price1 - price1;
        if(i==0){
            return 1;
        }
        return i;
    }

    public Computer() {
    }

    public Computer(String bond, int price, String color) {
        this.bond = bond;
        this.price = price;
        this.color = color;
    }

    public String getBond() {
        return bond;
    }

    public void setBond(String bond) {
        this.bond = bond;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    @Override
    public String toString() {
        return "Computer{" +
                "bond='" + bond + '\'' +
                ", price=" + price +
                ", color='" + color + '\'' +
                '}';
    }
}
